<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body{
  margin: 6px;
  padding: 0;
  font-size: 12px;
  font-family: tahoma, arial;
  background: #fff;
}

table{
  width: 100%;
}
tr.odd{
  background: #fff;
 }
 tr.even{
  background: #eee;
}

div.datagrid_div{
 width: 100%;
 border: 1px solid #999;
}

/*****************样式1*******************/
 table.datagrid1{
  border-collapse: collapse;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 th{
  color: #333;
  padding: 3px;
  font-family: monospace;
  background: #9cf;
  text-align: center;
  border-top: 1px solid #666;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 td{
  padding: 3px;
  border-top: 1px solid #ccc;
 }

 tr:hover,
 tr.hover{
  background: #9cf;
 }
 </style>
<script type="text/javascript">
function add_event(tr){
	   tr.onmouseover = function(){
	    tr.className += ' hover';
	   };
	   tr.onmouseout = function(){
	    tr.className = tr.className.replace(' hover', '');
	   };
	  }

	  function stripe(table) {
	   var trs = table.getElementsByTagName("tr");
	   for(var i=1; i<trs.length; i++){
	    var tr = trs[i];
	    tr.className = i%2 != 0? 'odd' : 'even';
	    add_event(tr);
	   }
	  }

	  window.onload = function(){
	   var tables = document.getElementsByTagName('table');
	   for(var i=0; i<tables.length; i++){
	    var table = tables[i];
	    table.className="datagrid1";
	    stripe(tables[i]);
	   }
	  } 
</script>
<title>考试查看</title>
</head>
<body>
<div><b>您现在的位置是：我的考试 &gt;&gt;考试查看</b></div>
<div style="margin: 0.3em;">
<form action="exam.action" method="post" >
	<input type="hidden" name="action" value="search" />
	考试名称：<input type="text" name="name"/> <input type="submit" value="查询" onclick="document.getElementsByTagName('jsp:include').page='../../commons/Pagelist1.jsp'" />
	<a href="exam.action?action=list" onclick="document.getElementsByTagName('jsp:include').page='../../commons/Pagelist.jsp'" >全部考试信息</a> 
</form>
</div>
<table cellspacing="1" border="0" style="color:#333333;width:100%;" align="center" >
	<tr>
		<th>编号</th>
		<th>考试名称</th>
		<th>出题方式</th>
		<th>开始时间</th>
		<th>结束时间</th>
		<th>操作</th>
	</tr>
	<s:if test="%{examList.size()!=0}">
	<s:iterator value="%{examList}" id="exam" status="status">
	<tr>
	<td>&nbsp;<s:property value="#status.count" /></td>
	<td><s:property value="#exam.name" /></td>
	<td>随机出题</td>
	<td><s:property value="#exam.startTime" /></td>
	<td><s:property value="#exam.endTime" /></td>
	<td>
	<input type="button" value="开始考试" onclick="location.href='${pageContext.request.contextPath }/admin/exam/exam.action?action=exam&id=<s:property value="#exam.id"/>'"/>
	</td>
	</tr>
	</s:iterator>
	</s:if>
	<s:else>
		<tr>
		<td align="center" width="100%" colspan="6">
			无任何考试信息！
		</td>
		</tr>
	</s:else>
<!-- 分页部分 -->
<tr>
<td colspan="6">
	<div id="page2">
		<jsp:include page="../../commons/Pagelist.jsp"/>
	</div>
</td>
</tr>
</table>
</body>
</html>